import { NgModule } from '@angular/core';
// import { CommonModule } from "@angular/common";
// import { BrowserModule, } from '@angular/platform-browser';
// import { ReactiveFormsModule,FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule, Http } from '@angular/http';
// import { RouterModule } from '@angular/router';
// import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate';
import { ModalModule } from 'ng2-bootstrap/modal';

// import { AppComponent } from '../app.component';
import { RoutesConfig } from '../app.routes';
import { ArticleModule } from '../article/article.module';
import { UserModule } from "../user/user.module";
import { userActiveInter } from "../intercept/route/userActiveInter";
import { QuestionModule } from "../question/question.module";
import { userService } from "../user/share/user.service";
import { UserLoginService } from "../user/user-login/shared/user-login.service";
import { ShowModelComponent } from "../common/ShowModel/ShowModel.component";
import {requestOptionsProvider} from "../DefaultRequestOptions";
import {MyHttpServiceImp} from "../utils/myhttp/MyHttpServiceImp"
import {AppWindow} from "../utils/loadJScript";
export function createTranslateLoader(http: Http) {
  return new TranslateStaticLoader(http, './assets/i18n', '.json');
}

@NgModule({
  declarations: [
    // AppComponent,
    // ShowModelComponent
  ],
  imports: [
    // BrowserModule,
    // ReactiveFormsModule,
    // FormsModule,
    // CommonModule,
    HttpModule,
    UserModule,
    JsonpModule,
    ArticleModule,
    QuestionModule,
    // BrowserAnimationsModule,
    TranslateModule.forRoot({
      provide: TranslateLoader,
      useFactory: (createTranslateLoader),
      deps: [Http]
    }),
    //默认是h5模式导航 hash 模式方式如下
    //  RouterModule.forRoot(RoutesConfig,{useHash:true}),
    //h5方式
    // RouterModule.forRoot(RoutesConfig),
    ModalModule.forRoot(),
  ],
  // exports: [RouterModule],
  providers: [userActiveInter,AppWindow, userService,requestOptionsProvider,MyHttpServiceImp,UserLoginService],
  // bootstrap: [AppComponent]
})
export class mainModel { }
